import { BrowserWindow, ipcMain } from 'electron'

ipcMain.on(
  'setWindowSize',
  (event: Electron.IpcMainEvent, opt: { aspectRatio: number; width: number; height: number }) => {
    const win = BrowserWindow.fromWebContents(event.sender)!

    win.setAspectRatio(opt.aspectRatio)
    win.setBounds({ width: opt.width, height: opt.height })
  }
)
